//Accepted
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <iostream>
#include <list>
#include <deque>
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;


int main (){
	//freopen("in.txt", "r", stdin);//freopen("out.txt", "w", stdout);
	int n, a[100], sum, x, y, i;
	scanf("%d", &n);
	for(i=1;i<n;++i)scanf("%d", &a[i]);
	scanf("%d%d", &x, &y);
	for(sum=0,i=x;i<y;++i)sum+=a[i];
	printf("%d",sum);
	return 0;
}
